$(function () {
   obj.init();
});
var obj = new function () {
    'use strict';
    return {
        form:null,
        timer:null,
        init:function () {
            this.funObj().getQR();
            this.funObj().timeTask();
            this.listener();
        },
        listener:function () {
            var $this = this;
            
            $('#refresh').click(function () {
                $this.funObj().getQR();
            })
        },
        funObj:function () {
            var $this = this;
            return {
                getQR:function () {
                    $.ajax({
                        url:baseUrl+'mobile/shortcut/getAuthQR',
                        // data:{userId: userId},
                        dataType:'json',
                        method:'post',
                        success:function (res) {
                            $('#loginQR').attr('src' , res.msg);
                        }
                    })
                },
                timeTask:function () {
                    setInterval(function (args) {
                        $this.funObj().getQR();
                    }, 5*1000);
                }

            }
        }
    }
};